require('page/common/header/index.js')

var _order_service = require('service/order-service.js');
var ListTempalte = require('./index.string');
var _util = require('util/util.js');
var _order_service = require('service/order-service.js');

var myOrder = {

    MyOrderData: {
        orderList:{},
    },

    init: function () {
        this.bindEvents();
        this.loadOrder()
        return this;
    },


    bindEvents: function () {
        var that = this
        // $('#confirmed').on('click', function () {
        //     that.submit()
        // });
        
    },
    loadOrder: function () {
        this.getListOrder()
    },

    getListOrder: function() {
        var that = this
        _order_service.getListOrder(
            function(resp){
                console.log(resp)
                that.MyOrderData.orderList = resp;
                var result = _util.renderHtml(ListTempalte, { MyOrderData: that.MyOrderData });
                $('#myOrder1').html(result);
            }
            ,
            function(errMsg){
                console.log(errMsg)
            }
        )
    },

}

module.exports = myOrder.init();